﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class ContractTransfer : ActiveRecordBase<ContractTransfer>
    {
		#region Const Definition
		
		public const string CONST_ContractTransferID					= "ContractTransferID";
		public const string CONST_TransferDate							= "TransferDate";
		public const string CONST_TransferMoney							= "TransferMoney";
		public const string CONST_ContractNo							= "ContractNo";
		public const string CONST_PreContractID							= "PreContractID";
		public const string CONST_UpdateDate							= "UpdateDate";
		public const string CONST_TransferType							= "TransferType";
		public const string CONST_RemainMoney							= "RemainMoney";
        public const string CONST_BDID                             = "BDID";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _contractTransferID;
        
        // Non Key
        private Nullables.NullableDateTime _transferDate;
        private System.Double _transferMoney;
        private System.String _contractNo;
        private Nullables.NullableDateTime _updateDate;
        private System.String _transferType;
        private System.Double _remainMoney;
        private Nullables.NullableInt32 _bdID;

        // Parents
        private PreContractInfo _preContractID;
        
        
		

        #endregion

        public ContractTransfer() {
               
        }
        public ContractTransfer(
            Nullables.NullableDateTime transferDate
            ,System.Double transferMoney
            ,System.String contractNo
            ,Nullables.NullableDateTime updateDate
            ,System.String transferType
            ,System.Double remainMoney
            , Nullables.NullableInt32 bdID)
            : this()
        {
                
            this._transferDate = transferDate; 
            this._transferMoney = transferMoney; 
            this._contractNo = contractNo; 
            this._updateDate = updateDate; 
            this._transferType = transferType; 
            this._remainMoney = remainMoney;
            this._bdID = bdID;
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_CONTRACTTRANSFER_CONTRACTTRANSFERID")]
		#endif
        public System.Int32 ContractTransferID {
            get { return this._contractTransferID; }
            set {  this._contractTransferID = value; }
        }
        
        // Non Key
        [Property]
        public Nullables.NullableDateTime TransferDate {
            get { return this._transferDate; }
			set { this._transferDate = value; }
        }
        
        [Property]
        public System.Double TransferMoney {
            get { return this._transferMoney; }
			set { this._transferMoney = value; }
        }
        
        [Property]
        public System.String ContractNo {
            get { return this._contractNo; }
			set { if (value == null) return; if (value.Length > 20) this._contractNo = value.Substring(0,20); else this._contractNo = value; }	
        }
        
        [Property]
        public Nullables.NullableDateTime UpdateDate {
            get { return this._updateDate; }
			set { this._updateDate = value; }
        }
        
        [Property]
        public System.String TransferType {
            get { return this._transferType; }
			set { if (value == null) return; if (value.Length > 50) this._transferType = value.Substring(0,50); else this._transferType = value; }	
        }
        
        [Property]
        public System.Double RemainMoney {
            get { return this._remainMoney; }
			set { this._remainMoney = value; }
        }

        [Property]
        public Nullables.NullableInt32 BDID
        {
            get { return this._bdID; }
            set { this._bdID = value; }
        }
        
        // Parent Relationships
        [BelongsTo("PreContractID")]
        public PreContractInfo PreContractID {
            get { return this._preContractID; }
            set { this._preContractID = value; }
        }
        
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public ContractTransfer Clone()
		{
			ContractTransfer newContractTransfer = new ContractTransfer();
			
            newContractTransfer.TransferDate = this._transferDate; 
            newContractTransfer.TransferMoney = this._transferMoney; 
            newContractTransfer.ContractNo = this._contractNo; 
            newContractTransfer.UpdateDate = this._updateDate; 
            newContractTransfer.TransferType = this._transferType; 
            newContractTransfer.RemainMoney = this._remainMoney;
            newContractTransfer.BDID = this._bdID; 
            newContractTransfer.PreContractID = this._preContractID ; 
			return newContractTransfer;
		}
    }
}



